<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="../../css/allApp.css" />
		<link rel="stylesheet" href="css/css.css" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<style type="text/css">
		.textarea textarea{
			min-height: 100px;
		}
		
		.mui-content {
			padding-bottom: 70px;
		}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">免巡检申请</h1>
		</header>
		<div class="mui-content">
			<div class="xj-content">
				<div class="H-10"></div>
				<div class="mui-card">
					<!--页眉，放置标题-->
					<!--内容区-->
					<div class="mui-card-content" style="border: 0;">
						<p class="biaozhun"></p>
						<div class="yichang-text">
							<div class="textarea">

								<textarea placeholder="请输入"></textarea>
							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
		<div class="btn">
			<button type="button" class="mui-btn mui-btn-primary mui-col-2 " id="sure">确定</button>
			<button type="button" class="mui-btn mui-btn-default mui-col-2" id="cancle">取消</button>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="../../js/mkeyplus.base.xunjian.js"></script>
		<script src="../../js/uuid.js"></script>
		<script type="text/javascript" src="../../js/common.js"></script>
		<script src="./js/mui.previewimage.js"></script>
		<script src="./js/mui.zoom.js"></script>
		<script type="text/javascript">
			mui.init();
			mui.previewImage();
			//添加图片
			mui.plusReady(function() {
				var self = plus.webview.currentWebview();
				var Idarr= self.Idarr;
				Idarr=Idarr.join(',');
				console.log(Idarr);
				
				mui('.btn').on('tap', '#sure', function() {
					var Text = $('.textarea textarea').val().trim();
					var main = plus.webview.getWebviewById("xianchangxunjian.html");
					if(Text==""){
						mui.toast('请填写原因');
					}else{
						var btnArr = ['确认', '取消'];
						mui.confirm('确认提交吗?', '操作提示', btnArr, function(e) {
							if(e.index == 0) {
								console.log('Idarr');
								plus.nativeUI.showWaiting('提交中...');
								mui.baseApp.httpRequst('/api/v2/sbxj/UpdateNotXjList', {
									xjIds: Idarr,
									reason: Text
								}, function(data) {
									plus.nativeUI.closeWaiting();
									console.log('111111' + JSON.stringify(data));
									if(data.status == "200") {
										mui.toast(data.message);
										
										plus.webview.currentWebview().close();
										var id=plus.webview.currentWebview().opener().id;
										var page1 = plus.webview.getWebviewById(id);
										mui.fire(page1, 'pull');
										var page = plus.webview.getWebviewById("jiankong.html");
										mui.fire(page, 'home');
									} else if(data.status == "400") {
										mui.toast(data.message);
									}

								})
							}

						});
					}
					
				});
				mui('.btn').on('tap', '#cancle', function() {
					mui.back();
				});
				
			});
		</script>
	</body>

</html>